
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Java基础 · My Study Note</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="yanglonglong">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-flexible-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Java多线程.html" />
    
    
    <link rel="prev" href="JavaByteCode.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://www.yangllong.top/" target="_blank" class="custom-link">My Blog</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Linux相关/">
            
                <a href="../Linux相关/">
            
                    
                    Linux相关
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../Linux相关/make工具的使用.html">
            
                <a href="../Linux相关/make工具的使用.html">
            
                    
                    Make工具的使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../springboot/">
            
                <a href="../springboot/">
            
                    
                    Springboot
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../springboot/springboot一些遇到的问题.html">
            
                <a href="../springboot/springboot一些遇到的问题.html">
            
                    
                    Springboot一些遇到的问题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../vue/">
            
                <a href="../vue/">
            
                    
                    Vue
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../vue/vue+ssm跨域问题.html">
            
                <a href="../vue/vue+ssm跨域问题.html">
            
                    
                    Vue+Ssm跨域问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../vue/vue-cli3.html">
            
                <a href="../vue/vue-cli3.html">
            
                    
                    Vue Cli3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../vue/安装vue.html">
            
                <a href="../vue/安装vue.html">
            
                    
                    安装Vue
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../其他/">
            
                <a href="../其他/">
            
                    
                    其他
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../其他/分布式系统.html">
            
                <a href="../其他/分布式系统.html">
            
                    
                    分布式系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../其他/图解http.html">
            
                <a href="../其他/图解http.html">
            
                    
                    图解Http
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../其他/消息队列.html">
            
                <a href="../其他/消息队列.html">
            
                    
                    消息队列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../其他/爬虫.html">
            
                <a href="../其他/爬虫.html">
            
                    
                    爬虫
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../刷题/">
            
                <a href="../刷题/">
            
                    
                    刷题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../刷题/NOJ.html">
            
                <a href="../刷题/NOJ.html">
            
                    
                    NOJ
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../刷题/leetcode/">
            
                <a href="../刷题/leetcode/">
            
                    
                    Leetcode
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../刷题/leetcode/107简单题.html">
            
                <a href="../刷题/leetcode/107简单题.html">
            
                    
                    107简单题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.3.1" data-path="../刷题/leetcode/2两数相加.html">
            
                <a href="../刷题/leetcode/2两数相加.html">
            
                    
                    2两数相加
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3.2" data-path="../刷题/leetcode/3无重复子串的最大长度.html">
            
                <a href="../刷题/leetcode/3无重复子串的最大长度.html">
            
                    
                    3无重复子串的最大长度
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../刷题/扇贝杯csdn.html">
            
                <a href="../刷题/扇贝杯csdn.html">
            
                    
                    扇贝杯Csdn
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../刷题/排序算法.html">
            
                <a href="../刷题/排序算法.html">
            
                    
                    排序算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../刷题/蓝桥杯.html">
            
                <a href="../刷题/蓝桥杯.html">
            
                    
                    蓝桥杯
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../刷题/蓝桥杯热身赛.html">
            
                <a href="../刷题/蓝桥杯热身赛.html">
            
                    
                    蓝桥杯热身赛
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../刷题/计算机等级考试(C语言">
            
                <span>
            
                    
                    计算机等级考试(C语言)
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../博客/">
            
                <a href="../博客/">
            
                    
                    博客
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../博客/next主题配置.html">
            
                <a href="../博客/next主题配置.html">
            
                    
                    Next主题配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../博客/一些问题的记录.html">
            
                <a href="../博客/一些问题的记录.html">
            
                    
                    一些问题的记录
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="./">
            
                <a href="./">
            
                    
                    学习Java
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="AQS.html">
            
                <a href="AQS.html">
            
                    
                    AQS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="HashMap的简单实现.html">
            
                <a href="HashMap的简单实现.html">
            
                    
                    HashMap的简单实现
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="JavaByteCode.html">
            
                <a href="JavaByteCode.html">
            
                    
                    JavaByteCode
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.8.4" data-path="Java基础.html">
            
                <a href="Java基础.html">
            
                    
                    Java基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="Java多线程.html">
            
                <a href="Java多线程.html">
            
                    
                    Java多线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="Java多线程并发.html">
            
                <a href="Java多线程并发.html">
            
                    
                    Java多线程并发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="Java爬虫.html">
            
                <a href="Java爬虫.html">
            
                    
                    Java爬虫
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="Java集合.html">
            
                <a href="Java集合.html">
            
                    
                    Java集合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.9" data-path="java常用类.html">
            
                <a href="java常用类.html">
            
                    
                    Java常用类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.10" data-path="jvm.html">
            
                <a href="jvm.html">
            
                    
                    Jvm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.11" data-path="noifelse.html">
            
                <a href="noifelse.html">
            
                    
                    Noifelse
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.12" data-path="socket.html">
            
                <a href="socket.html">
            
                    
                    Socket
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.13" data-path="一些Java方法.html">
            
                <a href="一些Java方法.html">
            
                    
                    一些Java方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.14" data-path="一些其他人写的博客.html">
            
                <a href="一些其他人写的博客.html">
            
                    
                    一些其他人写的博客
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.15" data-path="硬核空间.html">
            
                <a href="硬核空间.html">
            
                    
                    硬核空间
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.16" data-path="遇到的问题.html">
            
                <a href="遇到的问题.html">
            
                    
                    遇到的问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.17" data-path="阻塞队列.html">
            
                <a href="阻塞队列.html">
            
                    
                    阻塞队列
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../安卓开发/">
            
                <a href="../安卓开发/">
            
                    
                    安卓开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../安卓开发/First App.html">
            
                <a href="../安卓开发/First App.html">
            
                    
                    First App
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../安卓开发/problems.html">
            
                <a href="../安卓开发/problems.html">
            
                    
                    Problems
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../工具/">
            
                <a href="../工具/">
            
                    
                    工具
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../工具/IDEA.html">
            
                <a href="../工具/IDEA.html">
            
                    
                    IDEA
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../工具/docker.html">
            
                <a href="../工具/docker.html">
            
                    
                    Docker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../工具/github.html">
            
                <a href="../工具/github.html">
            
                    
                    Github
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../数据库/">
            
                <a href="../数据库/">
            
                    
                    数据库
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../数据库/MVCC.html">
            
                <a href="../数据库/MVCC.html">
            
                    
                    MVCC
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../数据库/MySQL.html">
            
                <a href="../数据库/MySQL.html">
            
                    
                    MySQL
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../数据库/Redis.html">
            
                <a href="../数据库/Redis.html">
            
                    
                    Redis
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../数据结构知识/">
            
                <a href="../数据结构知识/">
            
                    
                    数据结构知识
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="../数据结构知识/大话数据结构笔记1.html">
            
                <a href="../数据结构知识/大话数据结构笔记1.html">
            
                    
                    大话数据结构笔记1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.2" data-path="../数据结构知识/大话数据结构笔记2.html">
            
                <a href="../数据结构知识/大话数据结构笔记2.html">
            
                    
                    大话数据结构笔记2
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../面试笔试/">
            
                <a href="../面试笔试/">
            
                    
                    面试笔试
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../面试笔试/字节跳动5月11日笔试.html">
            
                <a href="../面试笔试/字节跳动5月11日笔试.html">
            
                    
                    字节跳动5月11日笔试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="../面试笔试/阿里3月23日笔试.html">
            
                <a href="../面试笔试/阿里3月23日笔试.html">
            
                    
                    阿里3月23日笔试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="../面试笔试/面试突击.html">
            
                <a href="../面试笔试/面试突击.html">
            
                    
                    面试突击
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >Java基础</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="java&#x57FA;&#x7840;">Java&#x57FA;&#x7840;</h2>
<h3 id="java&#x5F02;&#x5E38;">Java&#x5F02;&#x5E38;</h3>
<h4 id="&#x5F02;&#x5E38;&#x5206;&#x7C7B;">&#x5F02;&#x5E38;&#x5206;&#x7C7B;</h4>
<p>Throwable&#x662F;Java&#x8BED;&#x8A00;&#x4E2D;&#x6240;&#x6709;&#x9519;&#x8BEF;&#x6216;&#x5F02;&#x5E38;&#x7684;&#x8D85;&#x7C7B;&#x3002;&#x4E0B;&#x4E00;&#x5C42;&#x4E3A;Error&#x548C;Exception</p>
<p>Error&#x7C7B;&#x662F;&#x6307;Java&#x8FD0;&#x884C;&#x65F6;&#x7CFB;&#x7EDF;&#x7684;&#x5185;&#x90E8;&#x9519;&#x8BEF;&#x548C;&#x8D44;&#x6E90;&#x8017;&#x5C3D;&#x9519;&#x8BEF;&#x3002;</p>
<p>Exception&#x6709;&#x4E24;&#x4E2A;&#x5206;&#x652F;&#x8FD0;&#x884C;&#x65F6;&#x5F02;&#x5E38;RuntimeException&#x548C;&#x68C0;&#x67E5;&#x5F02;&#x5E38;CheckException</p>
<h4 id="&#x5F02;&#x5E38;&#x5904;&#x7406;&#x65B9;&#x5F0F;">&#x5F02;&#x5E38;&#x5904;&#x7406;&#x65B9;&#x5F0F;</h4>
<ol>
<li>throw</li>
<li>throws</li>
<li>&#x7CFB;&#x7EDF;&#x81EA;&#x52A8;&#x629B;&#x5F02;&#x5E38;</li>
</ol>
<h4 id="throw&#x4E0E;throws&#x7684;&#x533A;&#x522B;">Throw&#x4E0E;Throws&#x7684;&#x533A;&#x522B;</h4>
<p>&#x4F4D;&#x7F6E;&#x4E0D;&#x540C;</p>
<ol>
<li>throw&#x7528;&#x5728;&#x51FD;&#x6570;&#x4E0A;&#xFF0C;&#x540E;&#x9762;&#x8DDF;&#x5F02;&#x5E38;&#x7C7B;&#xFF0C;&#x53EF;&#x4EE5;&#x8DDF;&#x591A;&#x4E2A;&#xFF1B;throws&#x7528;&#x5728;&#x51FD;&#x6570;&#x5185;&#xFF0C;&#x540E;&#x9762;&#x8DDF;&#x7684;&#x662F;&#x5F02;&#x5E38;&#x5BF9;&#x8C61;</li>
</ol>
<p>&#x529F;&#x80FD;&#x4E0D;&#x540C;</p>
<ol>
<li>throws&#x7528;&#x6765;&#x58F0;&#x660E;&#x5F02;&#x5E38;&#xFF0C;&#x8BA9;&#x8C03;&#x7528;&#x8005;&#x53EA;&#x77E5;&#x9053;&#x8BE5;&#x529F;&#x80FD;&#x53EF;&#x80FD;&#x51FA;&#x73B0;&#x7684;&#x95EE;&#x9898;&#xFF1B;throw&#x629B;&#x51FA;&#x5177;&#x4F53;&#x7684;&#x95EE;&#x9898;&#x5BF9;&#x8C61;&#xFF0C;&#x6267;&#x884C;&#x5230;throw&#xFF0C;&#x529F;&#x80FD;&#x5C31;&#x7ED3;&#x675F;&#x4E86;</li>
<li>throws&#x8868;&#x793A;&#x51FA;&#x73B0;&#x5F02;&#x5E38;&#x7684;&#x4E00;&#x79CD;&#x53EF;&#x80FD;&#x6027;&#xFF0C;&#x5E76;&#x4E0D;&#x4E00;&#x5B9A;&#x4F1A;&#x53D1;&#x751F;&#x5F02;&#x5E38;&#xFF1B;throw&#x5219;&#x662F;&#x629B;&#x51FA;&#x4E86;&#x5F02;&#x5E38;&#xFF0C;&#x6267;&#x884C;throw&#x5219;&#x4E00;&#x5B9A;&#x629B;&#x51FA;&#x4E86;&#x67D0;&#x79CD;&#x5F02;&#x5E38;&#x5BF9;&#x8C61;</li>
</ol>
<h3 id="java&#x53CD;&#x5C04;">Java&#x53CD;&#x5C04;</h3>
<p>Java&#x53CD;&#x5C04;&#x673A;&#x5236;&#x662F;&#x6307;&#x5728;&#x8FD0;&#x884C;&#x72B6;&#x6001;&#x4E2D;&#xFF0C;&#x5BF9;&#x4E8E;&#x4EFB;&#x610F;&#x4E00;&#x4E2A;&#x7C7B;&#x90FD;&#x80FD;&#x77E5;&#x9053;&#x8FD9;&#x4E2A;&#x7C7B;&#x6240;&#x6709;&#x7684;&#x5C5E;&#x6027;&#x548C;&#x65B9;&#x6CD5;&#xFF1B;&#x5E76;&#x4E14;&#x5BF9;&#x4E8E;&#x4EFB;&#x610F;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x90FD;&#x80FD;&#x591F;&#x8C03;&#x7528;&#x5B83;&#x7684;&#x4EFB;&#x610F;&#x4E00;&#x4E2A;&#x65B9;&#x6CD5;</p>
<p><strong>&#x8FD0;&#x884C;&#x72B6;&#x6001;&#x65F6;&#x77E5;&#x9053;&#x7C7B;&#x6240;&#x6709;&#x7684;&#x5C5E;&#x6027;&#x548C;&#x65B9;&#x6CD5;</strong></p>
<p>&#x7F16;&#x8BD1;&#x65F6;&#x7C7B;&#x578B;&#x548C;&#x8FD0;&#x884C;&#x65F6;&#x7C7B;&#x578B;</p>
<pre><code class="lang-Java">Person p = <span class="hljs-keyword">new</span> Student();<span class="hljs-comment">//&#x7F16;&#x8BD1;&#x65F6;&#x4E3A;Person&#x7C7B;&#xFF0C;&#x8FD0;&#x884C;&#x65F6;&#x4E3A;Student&#x7C7B;</span>
</code></pre>
<h4 id="&#x53CD;&#x5C04;api">&#x53CD;&#x5C04;API</h4>
<ol>
<li>Class&#x7C7B;</li>
<li>Field&#x7C7B;</li>
<li>Method&#x7C7B;</li>
<li>Constructor&#x7C7B;</li>
</ol>
<h4 id="&#x53CD;&#x5C04;&#x4F7F;&#x7528;&#x6B65;&#x9AA4;&#xFF08;&#x83B7;&#x53D6;class&#x5BF9;&#x8C61;&#xFF0C;&#x8C03;&#x7528;&#x5BF9;&#x8C61;&#x65B9;&#x6CD5;&#xFF09;">&#x53CD;&#x5C04;&#x4F7F;&#x7528;&#x6B65;&#x9AA4;&#xFF08;&#x83B7;&#x53D6;Class&#x5BF9;&#x8C61;&#xFF0C;&#x8C03;&#x7528;&#x5BF9;&#x8C61;&#x65B9;&#x6CD5;&#xFF09;</h4>
<ol>
<li>&#x83B7;&#x53D6;&#x60F3;&#x8981;&#x64CD;&#x4F5C;&#x7684;&#x7C7B;&#x7684;Class&#x5BF9;&#x8C61;</li>
<li>&#x8C03;&#x7528;Class&#x7C7B;&#x4E2D;&#x7684;&#x65B9;&#x6CD5;</li>
<li>&#x4F7F;&#x7528;&#x53CD;&#x5C04;API&#x6765;&#x64CD;&#x4F5C;&#x8FD9;&#x4E9B;&#x4FE1;&#x606F;</li>
</ol>
<h4 id="&#x83B7;&#x53D6;class&#x5BF9;&#x8C61;&#x7684;3&#x79CD;&#x65B9;&#x6CD5;">&#x83B7;&#x53D6;Class&#x5BF9;&#x8C61;&#x7684;3&#x79CD;&#x65B9;&#x6CD5;</h4>
<ul>
<li>&#x8C03;&#x7528;&#x67D0;&#x4E2A;&#x5BF9;&#x8C61;getClass()&#x65B9;&#x6CD5;</li>
</ul>
<pre><code class="lang-java">Person p = <span class="hljs-keyword">new</span> Person();
Class aClass = p.getClass();
</code></pre>
<ul>
<li>&#x8C03;&#x7528;&#x67D0;&#x4E2A;&#x7C7B;&#x7684;class&#x5C5E;&#x6027;&#x6765;&#x83B7;&#x53D6;&#x8BE5;&#x7C7B;&#x7684;Class&#x5BF9;&#x8C61;</li>
</ul>
<pre><code class="lang-java">Class aClass = Person.class;
</code></pre>
<ul>
<li>&#x4F7F;&#x7528;Class&#x7C7B;&#x4E2D;&#x7684;forName()&#x9759;&#x6001;&#x65B9;&#x6CD5;&#xFF08;&#x6700;&#x5B89;&#x5168;/&#x6027;&#x80FD;&#x6700;&#x597D;&#xFF09;</li>
</ul>
<pre><code class="lang-Java">Class aClass = Class.forName(<span class="hljs-string">&quot;&#x7C7B;&#x7684;&#x5168;&#x8DEF;&#x5F84;&quot;</span>);<span class="hljs-comment">//&#x6700;&#x5E38;&#x7528;</span>
</code></pre>
<p> &#x83B7;&#x53D6;&#x4E86;&#x60F3;&#x8981;&#x64CD;&#x4F5C;&#x7684;&#x7C7B;&#x7684;Class&#x5BF9;&#x8C61;&#x540E;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;Class&#x7C7B;&#x4E2D;&#x7684;&#x65B9;&#x6CD5;&#x83B7;&#x53D6;&#x5E76;&#x67E5;&#x770B;&#x8BE5;&#x7C7B;&#x4E2D;&#x7684;&#x65B9;&#x6CD5;&#x548C;&#x5C5E;&#x6027;</p>
<pre><code class="lang-Java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyReflection</span> </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> <span class="hljs-keyword">throws</span> ClassNotFoundException </span>{
        <span class="hljs-comment">//&#x83B7;&#x53D6;Test&#x7C7B;&#x7684;Class&#x5BF9;&#x8C61;</span>
        Class aClass = Class.forName(<span class="hljs-string">&quot;interview.Test&quot;</span>);
        <span class="hljs-comment">//&#x83B7;&#x53D6;Test&#x7C7B;&#x7684;&#x6240;&#x6709;&#x65B9;&#x6CD5;&#x4FE1;&#x606F;</span>
        Method[] methods = aClass.getDeclaredMethods();
        <span class="hljs-keyword">for</span> (Method m : methods){
            System.out.println(m.toString());
        }

        <span class="hljs-comment">//&#x83B7;&#x53D6;Test&#x7C7B;&#x7684;&#x6240;&#x6709;&#x6210;&#x5458;&#x5C5E;&#x6027;&#x4FE1;&#x606F;</span>
        Field[] fields = aClass.getDeclaredFields();
        <span class="hljs-keyword">for</span> (Field f : fields){
            System.out.println(f.toString());
        }

        <span class="hljs-comment">//&#x83B7;&#x53D6;Test&#x7C7B;&#x7684;&#x6240;&#x6709;&#x6784;&#x9020;&#x65B9;&#x6CD5;&#x4FE1;&#x606F;</span>
        Constructor[] constructors = aClass.getDeclaredConstructors();
        <span class="hljs-keyword">for</span> (Constructor c : constructors){
            System.out.println(c.toString());
        }
    }

}
</code></pre>
<h4 id="&#x521B;&#x5EFA;&#x5BF9;&#x8C61;&#x7684;&#x4E24;&#x79CD;&#x65B9;&#x6CD5;">&#x521B;&#x5EFA;&#x5BF9;&#x8C61;&#x7684;&#x4E24;&#x79CD;&#x65B9;&#x6CD5;</h4>
<p>Class&#x5BF9;&#x8C61;&#x7684;newInstance()</p>
<ul>
<li>&#x4F7F;&#x7528;Class&#x5BF9;&#x8C61;&#x7684;newInstance()&#x65B9;&#x6CD5;&#x6765;&#x521B;&#x5EFA;&#x6539;Class&#x5BF9;&#x8C61;&#x5BF9;&#x5E94;&#x7684;&#x5B9E;&#x4F8B;&#xFF0C;&#x4F46;&#x662F;&#x8FD9;&#x79CD;&#x65B9;&#x6CD5;&#x8981;&#x6C42;&#x8BE5;Class&#x5BF9;&#x8C61;&#x5BF9;&#x5E94;&#x7684;&#x7C7B;<strong>&#x6709;&#x9ED8;&#x8BA4;&#x7684;&#x7A7A;&#x6784;&#x9020;&#x5668;</strong></li>
</ul>
<p>&#x8C03;&#x7528;Constructor&#x5BF9;&#x8C61;&#x7684;newInstance()</p>
<ul>
<li>&#x5148;&#x4F7F;&#x7528;Class&#x5BF9;&#x8C61;&#x83B7;&#x53D6;&#x6307;&#x5B9A;&#x7684;Constructor&#x5BF9;&#x8C61;&#xFF0C;&#x518D;&#x8C03;&#x7528;Constructor&#x5BF9;&#x8C61;&#x7684;newInstance()&#x65B9;&#x6CD5;&#x6765;&#x521B;&#x5EFA;Class&#x5BF9;&#x8C61;&#x5BF9;&#x5E94;&#x7C7B;&#x7684;&#x5B9E;&#x4F8B;</li>
</ul>
<pre><code class="lang-Java"><span class="hljs-comment">//&#x83B7;&#x53D6;Test&#x7C7B;&#x7684;Class&#x5BF9;&#x8C61;</span>
Class aClass = Class.forName(<span class="hljs-string">&quot;interview.Test&quot;</span>);
<span class="hljs-comment">//&#x4F7F;&#x7528;.newInstance&#x65B9;&#x6CD5;&#x521B;&#x5EFA;&#x5BF9;&#x8C61;</span>
Test t = (Test) aClass.newInstance();
<span class="hljs-comment">//&#x83B7;&#x53D6;&#x6784;&#x9020;&#x5668;&#x65B9;&#x6CD5;&#x5E76;&#x521B;&#x5EFA;&#x5BF9;&#x8C61;</span>
Constructor c = aClass.getDeclaredConstructor(<span class="hljs-keyword">int</span>.class);
<span class="hljs-comment">//&#x521B;&#x5EFA;&#x5BF9;&#x8C61;&#x5E76;&#x8BBE;&#x7F6E;&#x5C5E;&#x6027;</span>
Test t1 = (Test) c.newInstance(<span class="hljs-number">10</span>);
</code></pre>
<h3 id="java&#x6CE8;&#x89E3;">Java&#x6CE8;&#x89E3;</h3>
<p>&#x662F;Java&#x63D0;&#x4F9B;&#x7684;&#x4E00;&#x79CD;&#x5BF9;&#x5143;&#x7A0B;&#x5E8F;&#x4E2D;&#x5143;&#x7D20;&#x5173;&#x8054;&#x4FE1;&#x606F;&#x548C;&#x5143;&#x6570;&#x636E;&#x7684;&#x9014;&#x5F84;&#x548C;&#x65B9;&#x6CD5;</p>
<p>Annotation&#x662F;&#x4E00;&#x4E2A;&#x63A5;&#x53E3;&#xFF0C;&#x7A0B;&#x5E8F;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x53CD;&#x5C04;&#x6765;&#x83B7;&#x53D6;&#x6307;&#x5B9A;&#x7A0B;&#x5E8F;&#x4E2D;&#x7684;&#x5143;&#x7D20;&#x7684;Annotation&#x5BF9;&#x8C61;&#xFF0C;&#x7136;&#x540E;&#x901A;&#x8FC7;&#x8BE5;Annotation&#x5BF9;&#x8C61;&#x6765;&#x83B7;&#x53D6;&#x6CE8;&#x89E3;&#x4E2D;&#x7684;&#x5143;&#x6570;&#x636E;&#x4FE1;&#x606F;</p>
<h4 id="4&#x79CD;&#x6807;&#x51C6;&#x5143;&#x6CE8;&#x89E3;">4&#x79CD;&#x6807;&#x51C6;&#x5143;&#x6CE8;&#x89E3;</h4>
<p>&#x5143;&#x6CE8;&#x89E3;&#x7684;&#x4F5C;&#x7528;&#x662F;&#x8D1F;&#x8D23;&#x6CE8;&#x89E3;&#x5176;&#x4ED6;&#x6CE8;&#x89E3;</p>
<h5 id="target&#x4FEE;&#x9970;&#x5BF9;&#x8C61;&#x7684;&#x8D4B;&#x503C;&#x8303;&#x56F4;">@Target&#x4FEE;&#x9970;&#x5BF9;&#x8C61;&#x7684;&#x8D4B;&#x503C;&#x8303;&#x56F4;</h5>
<p>&#x53EF;&#x88AB;&#x7528;&#x4E8E;packages&#xFF0C;types&#xFF0C;&#x7C7B;&#x578B;&#x6210;&#x5458;&#xFF0C;&#x65B9;&#x6CD5;&#x53C2;&#x6570;&#x548C;&#x672C;&#x5730;&#x53D8;&#x91CF;</p>
<h5 id="retention&#x5B9A;&#x4E49;&#x88AB;&#x4FDD;&#x7559;&#x7684;&#x65F6;&#x957F;">@Retention&#x5B9A;&#x4E49;&#x88AB;&#x4FDD;&#x7559;&#x7684;&#x65F6;&#x957F;</h5>
<p>&#x5B9A;&#x4E49;&#x6CE8;&#x89E3;&#x88AB;&#x4FDD;&#x7559;&#x7684;&#x65F6;&#x95F4;&#x957F;&#x77ED;</p>
<ul>
<li>SOURCE&#xFF1A;&#x5728;&#x6E90;&#x6587;&#x4EF6;&#x4E2D;&#x6709;&#x6548;</li>
<li>CLASS&#xFF1A;&#x5728;class&#x6587;&#x4EF6;&#x4E2D;&#x6709;&#x6548;</li>
<li>RUNTIME&#xFF1A;&#x5728;&#x8FD0;&#x884C;&#x65F6;&#x6709;&#x6548;</li>
</ul>
<h5 id="document&#x63CF;&#x8FF0;-javadoc">@Document&#x63CF;&#x8FF0;-javadoc</h5>
<h5 id="inherited&#x9610;&#x8FF0;&#x4E86;&#x67D0;&#x4E2A;&#x88AB;&#x6807;&#x6CE8;&#x7684;&#x7C7B;&#x578B;&#x662F;&#x88AB;&#x7EE7;&#x627F;&#x7684;">@Inherited&#x9610;&#x8FF0;&#x4E86;&#x67D0;&#x4E2A;&#x88AB;&#x6807;&#x6CE8;&#x7684;&#x7C7B;&#x578B;&#x662F;&#x88AB;&#x7EE7;&#x627F;&#x7684;</h5>
<h4 id="&#x6CE8;&#x89E3;&#x5904;&#x7406;&#x5668;">&#x6CE8;&#x89E3;&#x5904;&#x7406;&#x5668;</h4>
<pre><code class="lang-Java"><span class="hljs-comment">/*&#x5B9A;&#x4E49;&#x6CE8;&#x89E3;*/</span>
<span class="hljs-meta">@Target</span>(ElementType.FIELD)
<span class="hljs-meta">@Retention</span>(RetentionPolicy.RUNTIME)
<span class="hljs-meta">@Documented</span>
<span class="hljs-keyword">public</span> <span class="hljs-meta">@interface</span> FruitProvider {
    <span class="hljs-comment">/*&#x4F9B;&#x5E94;&#x5546;&#x7F16;&#x53F7;*/</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">int</span> <span class="hljs-title">id</span><span class="hljs-params">()</span> <span class="hljs-keyword">default</span> -1</span>;

    <span class="hljs-comment">/*&#x4F9B;&#x5E94;&#x5546;&#x540D;&#x79F0;*/</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">name</span><span class="hljs-params">()</span> <span class="hljs-keyword">default</span> &quot;&quot;</span>;

    <span class="hljs-comment">/*&#x4F9B;&#x5E94;&#x5546;&#x5730;&#x5740;*/</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">address</span><span class="hljs-params">()</span> <span class="hljs-keyword">default</span> &quot;&quot;</span>;
}

<span class="hljs-comment">/*&#x6CE8;&#x89E3;&#x4F7F;&#x7528;*/</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Apple</span> </span>{
    <span class="hljs-meta">@FruitProvider</span>(id=<span class="hljs-number">1</span>,name = <span class="hljs-string">&quot;&#x6C5F;&#x82CF;&#x7EA2;&#x5BCC;&#x58EB;&#x96C6;&#x56E2;&quot;</span>,address = <span class="hljs-string">&quot;&#x6C5F;&#x82CF;&#x5357;&#x4EAC;&quot;</span>)
    <span class="hljs-keyword">private</span> String appleProvider;

    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">getAppleProvider</span><span class="hljs-params">()</span> </span>{
        <span class="hljs-keyword">return</span> appleProvider;
    }

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setAppleProvider</span><span class="hljs-params">(String appleProvider)</span> </span>{
        <span class="hljs-keyword">this</span>.appleProvider = appleProvider;
    }
}

<span class="hljs-comment">/*&#x6CE8;&#x89E3;&#x5904;&#x7406;&#x5668;*/</span>
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">FruitInfoUtil</span> </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">getFruitInfo</span><span class="hljs-params">(Class&lt;?&gt; aClass)</span> </span>{
        String strFruitProvider = <span class="hljs-string">&quot;&#x4F9B;&#x5E94;&#x5546;&#x4FE1;&#x606F;&quot;</span>;
        Field[] fields = aClass.getDeclaredFields();<span class="hljs-comment">//&#x901A;&#x8FC7;&#x53CD;&#x5C04;&#x83B7;&#x53D6;&#x5904;&#x7406;&#x6CE8;&#x89E3;</span>
        <span class="hljs-keyword">for</span> (Field field : fields) {
            <span class="hljs-keyword">if</span> (field.isAnnotationPresent(FruitProvider.class)) {
                FruitProvider fruitProvider = (FruitProvider) field.getAnnotation(FruitProvider.class);
                <span class="hljs-comment">//&#x6CE8;&#x89E3;&#x4FE1;&#x606F;&#x7684;&#x5904;&#x7406;&#x5730;&#x65B9;</span>
                strFruitProvider = <span class="hljs-string">&quot; &#x4F9B;&#x5E94;&#x5546;&#x7F16;&#x53F7;&#xFF1A;&quot;</span> + fruitProvider.id() + <span class="hljs-string">&quot; &#x4F9B;&#x5E94;&#x5546;&#x540D;&#x79F0;:&quot;</span>+fruitProvider.name()+<span class="hljs-string">&quot; &#x4F9B;&#x5E94;&#x5546;&#x5730;&#x5740;&#xFF1A;&quot;</span>+fruitProvider.address();
                System.out.println(strFruitProvider);
            }
        }
    }
}

<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">FruitRun</span> </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{
        FruitInfoUtil.getFruitInfo(Apple.class);
    }
}
</code></pre>
<h3 id="&#x6CDB;&#x578B;">&#x6CDB;&#x578B;</h3>
<h4 id="&#x901A;&#x914D;&#x7B26;&#x6982;&#x5FF5;">&#x901A;&#x914D;&#x7B26;&#x6982;&#x5FF5;</h4>
<p>&#x901A;&#x914D;&#x7B26;&#x7C7B;&#x578B;&#x4E2D;&#xFF0C;&#x5141;&#x8BB8;&#x7C7B;&#x578B;&#x53C2;&#x6570;&#x53D8;&#x5316;&#x3002;&#x4F8B;&#x5982;<code>List&lt;? extends Father&gt;</code>&#x8868;&#x793A;&#x4EFB;&#x4F55;&#x6CDB;&#x578B;List&#x7C7B;&#x578B;&#xFF0C;&#x5B83;&#x7684;&#x7C7B;&#x578B;&#x53C2;&#x6570;&#x662F;Father&#x7684;&#x5B50;&#x7C7B;&#xFF0C;&#x5982;<code>List&lt;Son&gt;</code></p>
<pre><code class="lang-java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Test</span> </span>{
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{
        List&lt;Son&gt; list = <span class="hljs-keyword">new</span> ArrayList&lt;&gt;();
        test(list);<span class="hljs-comment">//&#x8FD9;&#x91CC;&#x4F1A;&#x7F16;&#x8BD1;&#x9519;&#x8BEF;</span>
    }

    <span class="hljs-function"><span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">test</span><span class="hljs-params">(List&lt;Father&gt; list)</span> </span>{
        System.out.println(list.get(<span class="hljs-number">0</span>));
    }

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Father</span> </span>{

    }

    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Son</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Father</span></span>{

    }
}
</code></pre>
<p>&#x53EF;&#x4EE5;&#x5C06;test&#x51FD;&#x6570;&#x53C2;&#x6570;&#x6539;&#x6210;<code>List&lt;? extends Father&gt;</code>&#x7C7B;&#x578B;</p>
<p><code>List&lt;? super Son&gt;</code>&#x8868;&#x793A;&#x4EFB;&#x4F55;&#x6CDB;&#x578B;List&#x7C7B;&#x578B;&#xFF0C;&#x5B83;&#x7684;&#x7C7B;&#x578B;&#x53C2;&#x6570;&#x662F;Son&#x7684;&#x7236;&#x7C7B;&#xFF0C;&#x4F8B;&#x5982;<code>List&lt;Father&gt;</code></p>
<h3 id="java&#x5185;&#x90E8;&#x7C7B;">Java&#x5185;&#x90E8;&#x7C7B;</h3>
<p>&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x666E;&#x901A;&#x7684;Java&#x7C7B;&#xFF0C;&#x6709;3&#x4E2A;&#x6210;&#x5458;&#x53D8;&#x91CF;</p>
<pre><code class="lang-Java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">NestedClass</span> </span>{
    <span class="hljs-keyword">private</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">int</span> nestedClassPrivateStaticVar;
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">int</span> nestedClassPublicVar;
    <span class="hljs-keyword">protected</span> <span class="hljs-keyword">int</span> nestedClassProtectedVar;
}
</code></pre>
<h4 id="&#x9759;&#x6001;&#x6210;&#x5458;&#x7C7B;">&#x9759;&#x6001;&#x6210;&#x5458;&#x7C7B;</h4>
<p>&#x5728;&#x91CC;&#x9762;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;&#x9759;&#x6001;&#x7C7B;StaticMemberClass&#xFF0C;StaticMemberClass&#x5C31;&#x662F;&#x9759;&#x6001;&#x6210;&#x5458;&#x7C7B;</p>
<pre><code class="lang-Java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">NestedClass</span> </span>{

    <span class="hljs-keyword">private</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">int</span> nestedClassPrivateStaticVar;
    <span class="hljs-keyword">public</span> <span class="hljs-keyword">int</span> nestedClassPublicVar;
    <span class="hljs-keyword">protected</span> <span class="hljs-keyword">int</span> nestedClassProtectedVar;

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{
        <span class="hljs-comment">//&#x901A;&#x8FC7;&#x7C7B;&#x540D;&#x8C03;&#x7528;&#x9759;&#x6001;&#x5185;&#x90E8;&#x7C7B;&#x7684;&#x9759;&#x6001;&#x65B9;&#x6CD5;</span>
        StaticMemberClass.getNestedClassPrivateStaticVar();
        <span class="hljs-comment">//&#x901A;&#x8FC7;&#x7C7B;&#x540D;&#x8BBF;&#x95EE;&#x9759;&#x6001;&#x5185;&#x90E8;&#x7C7B;&#x7684;&#x9759;&#x6001;&#x6210;&#x5458;</span>
        System.out.println(<span class="hljs-string">&quot;&#x5916;&#x90E8;&#x7C7B;&#x901A;&#x8FC7;&#x7C7B;&#x540D;&#x8BBF;&#x95EE;&#x9759;&#x6001;&#x5185;&#x90E8;&#x7C7B;&#x7684;&#x9759;&#x6001;&#x6210;&#x5458;&#xFF1A;&quot;</span>+StaticMemberClass.staticPrivateValue);
    }

    <span class="hljs-comment">/**
     * 1.&#x9759;&#x6001;&#x6210;&#x5458;&#x7C7B;StaticMemberClass
     * &#x2605;&#x2605;&#x2605;&#x5C5E;&#x4E8E;&#x6574;&#x4E2A;&#x7C7B;&#xFF0C;&#x4E0D;&#x5C5E;&#x4E8E;&#x5355;&#x4E2A;&#x5B9E;&#x4F8B;&#x5BF9;&#x8C61;
     */</span>
    <span class="hljs-keyword">static</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">StaticMemberClass</span> </span>{

        <span class="hljs-comment">//&#x5916;&#x90E8;&#x7C7B;&#x53EF;&#x901A;&#x8FC7;&#x7C7B;&#x540D;&#x8BBF;&#x95EE;</span>
        <span class="hljs-keyword">private</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">int</span> staticPrivateValue;
        <span class="hljs-comment">//&#x5916;&#x90E8;&#x7C7B;&#x65E0;&#x6CD5;&#x8BBF;&#x95EE;</span>
        <span class="hljs-keyword">public</span> <span class="hljs-keyword">int</span> staticValue;

        <span class="hljs-function"><span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">getNestedClassPrivateStaticVar</span><span class="hljs-params">()</span> </span>{
            <span class="hljs-comment">//&#x53EF;&#x8BBF;&#x95EE;&#x5916;&#x90E8;&#x7C7B;&#x7684;&#x9759;&#x6001;&#x6210;&#x5458;&#x53D8;&#x91CF;</span>
            nestedClassPrivateStaticVar = <span class="hljs-number">0</span>;
            System.out.println(<span class="hljs-string">&quot;&#x901A;&#x8FC7;&#x9759;&#x6001;&#x5185;&#x90E8;&#x7C7B;&#x8BBF;&#x95EE;&#x5916;&#x90E8;&#x7C7B;&#x7684;&#x9759;&#x6001;&#x6210;&#x5458;&#x53D8;&#x91CF;&#xFF1A;&quot;</span> + nestedClassPrivateStaticVar);
        }
    }
}
<span class="hljs-comment">//&#x8FD0;&#x884C;&#x7ED3;&#x679C;</span>
<span class="hljs-comment">//&#x901A;&#x8FC7;&#x9759;&#x6001;&#x5185;&#x90E8;&#x7C7B;&#x8BBF;&#x95EE;&#x5916;&#x90E8;&#x7C7B;&#x7684;&#x9759;&#x6001;&#x6210;&#x5458;&#x53D8;&#x91CF;&#xFF1A;0</span>
<span class="hljs-comment">//&#x5916;&#x90E8;&#x7C7B;&#x901A;&#x8FC7;&#x7C7B;&#x540D;&#x8BBF;&#x95EE;&#x9759;&#x6001;&#x5185;&#x90E8;&#x7C7B;&#x7684;&#x9759;&#x6001;&#x6210;&#x5458;&#xFF1A;0</span>
</code></pre>
<h4 id="&#x975E;&#x9759;&#x6001;&#x6210;&#x5458;&#x7C7B;">&#x975E;&#x9759;&#x6001;&#x6210;&#x5458;&#x7C7B;</h4>
<h4 id="&#x5C40;&#x90E8;&#x7C7B;">&#x5C40;&#x90E8;&#x7C7B;</h4>
<h4 id="&#x533F;&#x540D;&#x5185;&#x90E8;&#x7C7B;">&#x533F;&#x540D;&#x5185;&#x90E8;&#x7C7B;</h4>
<p>&#x51FD;&#x6570;&#x5F0F;&#x63A5;&#x53E3;&#xFF1A;&#x53EA;&#x5305;&#x542B;&#x4E00;&#x4E2A;&#x62BD;&#x8C61;&#x65B9;&#x6CD5;&#x7684;&#x63A5;&#x53E3;&#xFF0C;&#x53EF;&#x4EE5;&#x5305;&#x542B;&#x591A;&#x4E2A;&#x9ED8;&#x8BA4;&#x65B9;&#x6CD5;&#x3001;&#x7C7B;&#x65B9;&#x6CD5;&#x3002;</p>
<p>&#x4F8B;&#x5982;&#xFF1A;Runnable&#xFF0C;ActionListener</p>
<h3 id="lambda&#x8868;&#x8FBE;&#x5F0F;">Lambda&#x8868;&#x8FBE;&#x5F0F;</h3>
<ul>
<li>Lambda&#x8868;&#x8FBE;&#x5F0F;&#x7684;&#x76EE;&#x6807;&#x7C7B;&#x578B;&#x5FC5;&#x987B;&#x662F;&#x51FD;&#x6570;&#x5F0F;&#x63A5;&#x53E3;</li>
<li>Lambda&#x8868;&#x8FBE;&#x5F0F;&#x53EA;&#x80FD;&#x4E3A;&#x51FD;&#x6570;&#x5F0F;&#x63A5;&#x53E3;&#x521B;&#x5EFA;&#x5BF9;&#x8C61;&#x3002;Lambda&#x8868;&#x8FBE;&#x5F0F;&#x53EA;&#x80FD;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;&#x65B9;&#x6CD5;</li>
</ul>
<p>Lambda&#x8868;&#x8FBE;&#x5F0F;&#x7684;&#x7ED3;&#x679C;&#x5C31;&#x662F;&#x88AB;&#x5F53;&#x6210;&#x5BF9;&#x8C61;</p>
<p>&#x91CC;&#x9762;&#x7684;&#x5916;&#x90E8;&#x53D8;&#x91CF;&#x5FC5;&#x987B;&#x88AB;final&#x4FEE;&#x9970;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="JavaByteCode.html" class="navigation navigation-prev " aria-label="Previous page: JavaByteCode">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Java多线程.html" class="navigation navigation-next " aria-label="Next page: Java多线程">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Java基础","level":"1.8.4","depth":2,"next":{"title":"Java多线程","level":"1.8.5","depth":2,"path":"学习java/Java多线程.md","ref":"学习java/Java多线程.md","articles":[]},"previous":{"title":"JavaByteCode","level":"1.8.3","depth":2,"path":"学习java/JavaByteCode.md","ref":"学习java/JavaByteCode.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-search","-lunr","-sharing","-anchor-navigation-ex","todo","code","-katex","github","-summary","search-pro","chapter-fold","theme-comscore","toggle-chapters","flexible-alerts"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"chapter-fold":{},"github":{"url":"https://github.com/BluePrintYang"},"todo":{},"search-pro":{},"code":{"copyButtons":true},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"showLevel":false,"showGoTop":true,"isRewritePageTitle":true,"isShowTocTitleIcon":true,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right"},"theme-comscore":{},"flexible-alerts":{"danger":{"className":"danger","icon":"fa fa-ban","label":"Attention"},"note":{"className":"info","icon":"fa fa-info-circle","label":"Note"},"style":"callout","tip":{"className":"tip","icon":"fa fa-lightbulb-o","label":"Tip"},"warning":{"className":"warning","icon":"fa fa-exclamation-triangle","label":"Warning"}},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"toggle-chapters":{}},"theme":"default","author":"yanglonglong","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"My Study Note","language":"zh-hans","links":{"sidebar":{"My Blog":"https://www.yangllong.top/"}},"gitbook":"*"},"file":{"path":"学习java/Java基础.md","mtime":"2020-06-29T16:04:36.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-01-14T07:15:50.272Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-flexible-alerts/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    </body>
</html>

